<?php
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Origin:*");

$data = json_decode(file_get_contents("php://input"), true);
$file = $data["file"] ?? "";

if (!$file || !file_exists("history/".$file)) {
    echo json_encode(["status"=>"error", "msg"=>"文件不存在"]);
    exit;
}

unlink("history/".$file);

echo json_encode(["status"=>"ok"]);
?>
